const Service = require('egg').Service;

class HomeService extends Service {
    async index() {
        // 就是用来处理业务逻辑的
        // const num = await this.app.mysql.query(`select * from blogs where id=1`)
        // get 查单个 {}
        // const num = await this.app.mysql.get('blogs', { id: 1 })
        // select 查多个 返回[]
        const num = await this.app.mysql.select('blogs', { where: { id: 1 } })
        return num;
    }
}

module.exports = HomeService;
